<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
			margin: 0;
			padding: 0;
		}
		.content{
			width: 802px;
			height: 600px;
			border:1px solid red;
			margin:20px auto;
			display:flex;
		}
        .content .left{
            display: flex;
            flex-direction: column;
        }
        .content .left-top{
            width: 400px;
            height: 400px;
            border-right:1px solid blue;
            position: relative;
            /* margin-bottom: 20px; */
            
        }
        .content .left-top img{
            width: 400px;
            height: 400px;
            /* display: block; */
            display: none;
        }
        .content .left-top .img{
            display: block;
        }

        

        .content .left-bottom{
            width: 400px;
            height: 400px;
            border-right:1px solid blue;
            border-top:1px solid blue;
            display: flex;
            
        }
        
        .content .left-bottom img{
            width: 80px;
			height: 80px;
            box-sizing: border-box;
           
        }
        .content .left-bottom  .active{
			display: block;
			border:5px solid orange;
		}
        .content .right{
            width: 400px;
            height: 400px;
            overflow: hidden;
            position: relative;
            display: none;
        }
        .content .right img{
            width: 800px;
            height: 800px;
            position: absolute;
            display: none;
        }
        .content .right img:nth-child(1){
            display: block;
        }
        .show{
            width: 200px;
            height: 200px;
            background: rgba(0,0,0,.5);
            position:absolute;
            display: none;
        }
        


    </style>
</head>
<body>
    <div class="content">
        <div class="left">
            <div class="left-top">
                <div class="show"></div>
                <img src="../img/2.jpeg" alt="" class="img">
                <img src="../img/3.jpg" alt="">
                <img src="../img/a.jpg" alt="">
                <img src="../img/c.jpg" alt="">
                <img src="../img/d.jpg" alt="">
            </div>
            <div class="left-bottom">
                    <img src="../img/2.jpeg" alt="" class="active">
                    <img src="../img/3.jpg" alt="">
                    <img src="../img/a.jpg" alt="">
                    <img src="../img/c.jpg" alt="">
                    <img src="../img/d.jpg" alt="">
            </div>
        </div>
        <div class="right">
                <img src="../img/2.jpeg" alt="">
                <img src="../img/3.jpg" alt="">
                <img src="../img/a.jpg" alt="">
                <img src="../img/c.jpg" alt="">
                <img src="../img/d.jpg" alt="">
        </div>
    </div>
    <script>
        function $(ele){
            return document.querySelector(ele)
        }
        let img1=$('.left-bottom').getElementsByTagName('img');
        for(let i=0;i<img1.length;i++){
            img1[i].index=i;
        }
        let img2=$('.left-top').getElementsByTagName('img');
        let img3=$('.right').getElementsByTagName('img');
        let index=0;
        $('.left-bottom').addEventListener('click',function(e){
            for(let i=0;i<img1.length;i++){
                img1[i].className='';
                img2[i].style.display='none'
                img3[i].style.display='none'

            }
            e.target.className='active';
            index=e.target.index;
            img2[index].style.display='block'
            img3[index].style.display='block'

        },false)
        $('.left-top').onmouseenter=function(){
            $('.show').style.display='block';
            $('.right').style.display='block';
            document.onmousemove=function(e){
                let x=e.clientX-$('.left-top').offsetLeft-100;
                let y=e.clientY-$('.left-top').offsetTop-100;
                x=x<0?0:x;
                x=x>200?200:x;
                y=y<0?0:y;
                y=y>200?200:y;
                $('.show').style.top=y+'px';
                $('.show').style.left=x+'px';
                x=x*2;
                y=y*2;
                img3[index].style.top=-y+'px';
                img3[index].style.left=-x+'px';




            }
        }
        $('.left-top').onmouseleave=function(){
             $('.show').style.display='none';

        }

    </script>
</body>
</html>